var util = require('../../utils/util.js');
var ajax = require('../../utils/ajax.js');
var common = require('../../utils/common.js');
var PageBase = require('../../common/PageBase.js');
var app = getApp();

Page(common.extendPage(PageBase, {
    data: {
        winHei: 0,
        dataLoaded: false,
        orderInfo:{},
        orderGoods:[]
    },

    onLoad(options) {
    	this._options = options;
    	this._getShopOrder();
    },

    onShow() {
    },
    /**
    * 获取订单详情
    */
    _getShopOrder:function(){
    	var url ="/market/Order/info";
    	var data = {
    		order_id:this._options.orderId
    	};
    	ajax.G({
    		url,
    		data,
    		success:(data)=>{
    			var orderInfo = data.result.order_info;
    			var orderGoods = data.result.order_goods;
    			this.setData({
    				orderInfo,
    				orderGoods,
                    dataLoaded:true,
                    winHei:app.getWinHei()
    			})
    		}
    	})
    }
}));